package com.nmgsr.ptmsapp.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.request.target.Target;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.nmgsr.beans.responsedao.SysRoleRes;
import com.nmgsr.ptmsapp.R;
import com.squareup.picasso.Picasso;

public class HomeListAdapter extends BaseQuickAdapter <SysRoleRes, BaseViewHolder>{
    public HomeListAdapter() {
        super(R.layout.home_list_item);
    }
    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, SysRoleRes list) {
        baseViewHolder.setText(R.id.tv_name, list.getName());
        baseViewHolder.setText(R.id.tv_code, "2025-06-01");
        baseViewHolder.setText(R.id.tv_address, "测试代码");

//        // 加载 GIF 图片到 ImageView
//        ImageView imageView = baseViewHolder.getView(R.id.img_time);
//        Glide.with(imageView.getContext())
//                .asGif() // 如果你要播放 GIF 动画
//                .load(R.raw.note) // 确保 res/raw/note.gif 存在
//                .into(imageView); // 正确用法：直接传入 ImageView
    }
}
